- /* srfrrdiv.cpp by K.Tsuru */
- // function ID = 813 BRADIX
- /*****************
- SRational class
- operator x/y
- (x.num/x.den) x.num * y.den
- --------------=---------------
- (y.num/y.den) x.den * y.num
-
- *****************/
- #ifndef SN_H
- #include "sn.h"
- #endif
- SRational RRDiv(const SRational& x, const SRational& y){
- if(y.Sign(813) == 0) x.num.SetError(x.num.DIVIDED_BY_ZERO,"SR /", 813);
- SRational z; // z.reduceDone = false;
- if((&x == &y) || (x == y)) z.SetLong(1, 1); // x/x
- else if(x.Sign(813) == 0) z.SetZero();
- else {
- z.num = x.num*y.den; z.den = x.den*y.num;
- z.reduce(false);
- }
- return z;
- }
srfrrdiv.cpp : last modifiled at 2016/06/26 16:27:16(628 bytes)
created at 2016/06/26 15:57:35
The creation time of this html file is 2016/09/18 20:28:04 (Sun Sep 18 20:28:04 2016).